/**
 * 
 */
package com.jysz.webcore.ssh.entity;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.MappedSuperclass;
import javax.persistence.Transient;

/**
 * @author kacarich email:javaengine@outlook.com
 *
 */
@MappedSuperclass
public abstract class NulEntity<PK extends Serializable> {

	/**
	 * 创建时间
	 */
	private Date createdAt;
	/**
	 * 更新时间
	 */
	private Date updatedAt;
	/**
	 * 创建者
	 */
	private String creator;
	/**
	 * 修改者
	 */
	private String modifier;

	@Transient
	public abstract PK getId();
	
	public abstract void setId(PK id);
	
	public void setCreatedAt(Date createdAt) {
		this.createdAt = createdAt;
	}
	
	@Basic
	@Column(name="created_at", columnDefinition="datetime")
	public Date getCreatedAt() {
		return createdAt;
	}

	public void setUpdatedAt(Date updatedAt) {
		this.updatedAt = updatedAt;
	}
	
	@Basic
	@Column(name="updated_at", columnDefinition="datetime")
	public Date getUpdatedAt() {
		return updatedAt;
	}

	public void setModifier(String modifier) {
		this.modifier = modifier;
	}

	@Basic
	public String getModifier() {
		return modifier;
	}

	public void setCreator(String creator) {
		this.creator = creator;
	}

	@Basic
	public String getCreator() {
		return creator;
	}

}
